package com.neoCalf.neoCommon.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum ContactApplyStatusEnum {
    INIT(0, "待同意"),
    AGREE(1, "已同意"),
    REJECT(2, "已拒绝"),
    BLACKLIST(3, "已拉黑");

    private final Integer status;
    private final String description;

    public static ContactApplyStatusEnum getByPrefix(Integer type) {
        if (type == null) {
            return null;
        }
        for (ContactApplyStatusEnum typeEnum : ContactApplyStatusEnum.values()) {
            if (typeEnum.getStatus().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
